home *** CD-ROM | disk | FTP | other *** search
Wrap
property theType, theCategory, paletteCast, paletteCounter, paletteWidth, totalBanks, currentBank, bookmarkList, bookmarkTotal, bookmarkIndex, paletteDataList, paletteRecord, defaultBgdCast, editPaletteType, previousBankList, showingPreviousPalette, currentPalette, isSoundPalette, kHiliterWidth, kHiliterHeight global palBkgndSpr, palArrowSpr, palTitleSpr, bookmarkSpr, palAnimeSpr, palHiliteSpr, selectionHiliteSpr, palHoldSpr, palDeleteSpr, volumePanelSpr, volumeSliderSpr, paletteVisibleP, editPaletteP, volumePaletteP on birth me set selectionHiliteSpr to 17 set palBkgndSpr to selectionHiliteSpr + 1 set palArrowSpr to selectionHiliteSpr + 2 set palTitleSpr to selectionHiliteSpr + 3 set bookmarkSpr to selectionHiliteSpr + 3 set palAnimeSpr to selectionHiliteSpr + 4 set palHiliteSpr to selectionHiliteSpr + 5 puppetSprites(selectionSpr, palHiliteSpr, 1) set palHoldSpr to palArrowSpr set palDeleteSpr to bookmarkSpr set volumePanelSpr to palArrowSpr set volumeSliderSpr to bookmarkSpr set paletteDataList to [#HOM: [#c, #HOM, 1, 2, the number of cast "homer bookmark", the number of cast "homer palette"], #MAR: [#c, #MAR, 1, 2, the number of cast "marge bookmark", the number of cast "marge palette"], #bar: [#c, #bar, 1, 2, the number of cast "bart bookmark", the number of cast "bart palette"], #LIS: [#c, #LIS, 1, 2, the number of cast "lisa bookmark", the number of cast "lisa palette"], #MAG: [#c, #MAG, 1, 2, the number of cast "maggie bookmark", the number of cast "maggie palette"], #CAM: [#c, #BUR, 1, 3, the number of cast "burns bookmark", the number of cast "burns palette"], #PRP: [#p, #fur, 1, 1, the number of cast "props base bookmark", the number of cast "props base palette"], #bgd: [#b, #SCE, 1, 1, the number of cast "backgrounds base bookmark", the number of cast "backgrounds base palette"], #SFX: [#x, #FGD, 1, 1, the number of cast "sfx base bookmark", the number of cast "sfx base palette"], #LOO: [#l, #LOO, 1, 1, the number of cast "sounds base bookmark", the number of cast "sounds base palette"]] set previousBankList to [#HOM: [1, 0], #MAR: [1, 0], #bar: [1, 0], #LIS: [1, 0], #MAG: [1, 0], #CAM: [1, 0], #PRP: [1, 0], #bgd: [1, 0], #SFX: [1, 0], #LOO: [1, 0]] set defaultBgdCast to the number of cast "default palette background" set bookmarkList to [:] set showingPreviousPalette to 0 set paletteVisibleP to 0 set editPaletteP to 0 set volumePaletteP to 0 return me end on showPalette me, whichPalette set currentPalette to whichPalette if (whichPalette = #FullEdit) or (whichPalette = #partialEdit) then showEditPalette(me, whichPalette) else if whichPalette = #volume then showVolumeControl(me) else set the locH of sprite palHiliteSpr to -1000 showContentPalette(me, whichPalette) end if end if set paletteVisibleP to 1 set paletteCounter to 1 updateStage() end on showContentPalette me, whichPalette set editPaletteP to 0 set volumePaletteP to 0 if whichPalette = #LOO then set isSoundPalette to 1 set kHiliterWidth to 91 + 2 set kHiliterHeight to 58 / 2 else set isSoundPalette to 0 set kHiliterWidth to 47 set kHiliterHeight to 58 end if set the castNum of sprite palArrowSpr to the number of cast "palette scroll arrows" set the rect of sprite palArrowSpr to the rect of cast "palette scroll arrows" set the rect of sprite palTitleSpr to the rect of cast "palette title reference" set the locV of sprite palArrowSpr to 92 set the locV of sprite palTitleSpr to 92 set bookmarkList to [:] set the castNum of sprite palBkgndSpr to defaultBgdCast set paletteRecord to getaProp(paletteDataList, whichPalette) set theType to getAt(paletteRecord, 1) set theCategory to getAt(paletteRecord, 2) set currentBank to getAt(paletteRecord, 3) set totalBanks to getAt(paletteRecord, 4) if theType = #c then set paletteCast to getAt(paletteRecord, 6) + ((currentBank - 1) * 4) else set paletteCast to getAt(paletteRecord, 6) + (currentBank - 1) end if set the castNum of sprite palAnimeSpr to paletteCast set paletteWidth to the width of cast paletteCast set the width of sprite palAnimeSpr to paletteWidth set the locH of sprite palBkgndSpr to 313 set the locH of sprite palArrowSpr to 313 set the locH of sprite palTitleSpr to 313 set the locH of sprite palAnimeSpr to 313 if theType = #c then if whichPalette = #CAM then set bookmarkList to [#BUR: 3, #KRU: 2, #CAM: 2] else setaProp(bookmarkList, theCategory, totalBanks) end if showTitlePalette() else if theType = #p then set bookmarkList to [#fur: 1, #APP: 1, #foo: 1, #PLA: 1, #ANI: 1, #IND: 1, #MIS: 1, #PPC: 1] showBookmarkPalette() else if theType = #x then set bookmarkList to [#FGD: 1, #TRA: 1, #end: 1, #bgd: 1] showBookmarkPalette() else if theType = #b then set bookmarkList to [#SCE: 1] showBookmarkPalette() else if (theType = #n) or (theType = #l) then set bookmarkList to [#LOO: 1, #VOS: 5, #HUM: 2] showBookmarkPalette() end if end if end if end if end if showPreviousPalette(me, whichPalette) end on showPreviousPalette me, whichPalette set previousPalette to getaProp(previousBankList, whichPalette) if getAt(previousPalette, 2) <> 0 then if getAt(previousPalette, 1) <> 0 then repeat with i = 1 to getAt(previousPalette, 1) - 1 switchBank("right") end repeat end if repeat with i = 1 to 4 startTimer() set showingPreviousPalette to 1 set the locH of sprite palHiliteSpr to -1000 updateStage() repeat while the timer < 6 end repeat hilite(me, getAt(previousPalette, 2)) updateStage() repeat while the timer < 6 end repeat end repeat end if end on showEditPalette me, whichPalette set editPaletteP to 1 set volumePaletteP to 0 set editPaletteType to whichPalette set the castNum of sprite palBkgndSpr to defaultBgdCast set the locH of sprite palBkgndSpr to 313 if whichPalette = #FullEdit then set the castNum of sprite palHoldSpr to the number of cast "hold palette" set the castNum of sprite palDeleteSpr to the number of cast "delete palette" else set the castNum of sprite palHoldSpr to the number of cast "partial hold palette" set the castNum of sprite palDeleteSpr to the number of cast "partial delete palette" end if set the rect of sprite palHoldSpr to the rect of cast "hold palette" set the locH of sprite palHoldSpr to 313 set the locV of sprite palHoldSpr to 100 set the rect of sprite palDeleteSpr to the rect of cast "delete palette" set the locH of sprite palDeleteSpr to 313 set the locV of sprite palDeleteSpr to 180 set editPaletteP to 1 end on showVolumeControl me set editPaletteP to 0 set volumePaletteP to 1 set the castNum of sprite volumePanelSpr to the number of cast "volume panel" set the rect of sprite volumePanelSpr to the rect of cast "volume panel" set the locH of sprite volumePanelSpr to 313 set the locV of sprite volumePanelSpr to 150 updateStage() set the castNum of sprite volumeSliderSpr to the number of cast "volume slider" set the rect of sprite volumeSliderSpr to the rect of cast "volume slider" set the locH of sprite volumeSliderSpr to 280 set the locV of sprite volumeSliderSpr to 150 set theVolumeIncrement to 24 set topOffset to 22 set volumePanelMinV to the top of sprite volumePanelSpr + topOffset set the locV of sprite volumeSliderSpr to volumePanelMinV + ((6 - getCurrentSoundLevel(appMgr)) * theVolumeIncrement) end on showTitlePalette set bookmarkTotal to count(bookmarkList) set bookmarkIndex to 1 set theTitleCast to getAt(paletteRecord, 5) set the castNum of sprite palTitleSpr to theTitleCast set the locH of sprite palTitleSpr to the locH of sprite palBkgndSpr set the width of sprite palTitleSpr to the width of cast theTitleCast set the height of sprite palTitleSpr to the height of cast theTitleCast end on showBookmarkPalette set bookmarkTotal to count(bookmarkList) set bookmarkIndex to 1 set bookmarkCast to getAt(paletteRecord, 5) set the castNum of sprite bookmarkSpr to bookmarkCast set the locH of sprite bookmarkSpr to the locH of sprite palBkgndSpr set the width of sprite bookmarkSpr to the width of cast bookmarkCast set the height of sprite bookmarkSpr to the height of cast bookmarkCast end on hidePalette me unLoadCast(231, 236) if currentPalette = #HOM then unLoadCast(341, 349) else if currentPalette = #MAR then unLoadCast(351, 359) else if currentPalette = #bar then unLoadCast(361, 369) else if currentPalette = #LIS then unLoadCast(371, 379) else if currentPalette = #MAG then unLoadCast(381, 389) else if currentPalette = #CAM then unLoadCast(391, 421) else if currentPalette = #PRP then unLoadCast(461, 476) else if currentPalette = #bgd then unLoadCast(451, 452) else if currentPalette = #SFX then unLoadCast(431, 450) else if currentPalette = #LOO then unLoadCast(841, 944) else if currentPalette = #FullEdit then unLoadCast(237, 238) else if currentPalette = #partialEdit then unLoadCast(239, 240) else if currentPalette = #volume then unLoadCast(218, 219) end if end if end if end if end if end if end if end if end if end if end if end if end if set the locH of sprite palBkgndSpr to -1000 set the locH of sprite palArrowSpr to -1000 set the locH of sprite palTitleSpr to -1000 set the locH of sprite palAnimeSpr to -1000 set the locH of sprite palHiliteSpr to -1000 set the locH of sprite selectionHiliteSpr to -1000 resetPanel(interfaceMgr) puppetSound(1, 0) puppetSound(2, 0) updateStage() set paletteVisibleP to 0 end on animate me if rollOver(palAnimeSpr) then set showingPreviousPalette to 0 hilite(me, 0) else if not showingPreviousPalette then set the locH of sprite palHiliteSpr to -1000 end if end if if (theType = #c) or (theType = #x) then if paletteCounter < 4 then set the castNum of sprite palAnimeSpr to the castNum of sprite palAnimeSpr + 1 set paletteCounter to paletteCounter + 1 else set the castNum of sprite palAnimeSpr to paletteCast set paletteCounter to 1 end if end if updateStage() end on hilite me, theColumn if isSoundPalette then set palettePictH to the left of sprite palAnimeSpr - 1 set palettePictV to the top of sprite palAnimeSpr if theColumn = 0 then set col to (the mouseH - palettePictH) / kHiliterWidth set row to (the mouseV - palettePictV) / kHiliterHeight else set col to theColumn - 5 + (5 * (theColumn <= 5)) - 1 set row to 0 > (5 - theColumn) end if set posH to palettePictH + (col * kHiliterWidth) set the locH of sprite palHiliteSpr to posH - col set posV to palettePictV + (row * kHiliterHeight) set the locV of sprite palHiliteSpr to posV set the width of sprite palHiliteSpr to kHiliterWidth set the height of sprite palHiliteSpr to kHiliterHeight else set palettePictH to the left of sprite palAnimeSpr - 1 if theColumn = 0 then set col to (the mouseH - palettePictH) / kHiliterWidth else set col to theColumn - 1 end if set posH to palettePictH + (col * kHiliterWidth) set the locH of sprite palHiliteSpr to posH - col set the locV of sprite palHiliteSpr to the top of sprite palAnimeSpr set the width of sprite palHiliteSpr to kHiliterWidth set the height of sprite palHiliteSpr to kHiliterHeight end if end on visibleP me return paletteVisibleP end on handleBtn me, theSpr, theMouseH, theMouseV if theSpr <> palBkgndSpr then if editPaletteP then editPaletteClick(me, theSpr, theMouseH) else if volumePaletteP then volumePaletteClick(me, theSpr, theMouseH, theMouseV) else contentPaletteClick(me, theSpr, theMouseH, theMouseV) end if end if end if end on editPaletteClick me, theSpr, theMouseH cursor(4) set theInterval to the width of sprite theSpr / 3 set theClickLocH to theMouseH - the left of sprite theSpr hidePalette(me) if theSpr = palHoldSpr then if editPaletteType = #FullEdit then set actionList to ["holdClip(editMgr, -1)", "holdClip(editMgr,0)", "holdClip(editMgr, 1)"] else set actionList to ["nothing", "nothing", "nothing"] end if else if theSpr = palDeleteSpr then if editPaletteType = #FullEdit then set actionList to ["deleteClip(editMgr,-1)", "deleteClip(editMgr,0)", "deleteClip(editMgr,1)"] else set actionList to ["nothing", "deleteClip(editMgr,0)", "nothing"] end if else if theSpr = palHiliteSpr then exit end if end if end if if theClickLocH < theInterval then do(getAt(actionList, 1)) else if theClickLocH < (theInterval * 2) then do(getAt(actionList, 2)) else do(getAt(actionList, 3)) end if end if cursor(-1) end on volumePaletteClick me, theSpr, theMouseH, theMouseV set theVolumeIncrement to 24 set topOffset to 22 set bottomOffset to 22 set volumePanelMinV to the top of sprite volumePanelSpr + topOffset set volumePanelMaxV to the bottom of sprite volumePanelSpr - bottomOffset if theSpr = volumeSliderSpr then repeat while the mouseDown if (the mouseV > volumePanelMinV) and (the mouseV < volumePanelMaxV) then set volumePosition to (the mouseV - volumePanelMinV) / theVolumeIncrement set newPosV to volumePanelMinV + (volumePosition * theVolumeIncrement) if newPosV <> the locV of sprite volumeSliderSpr then changeVolume(appMgr, 6 - volumePosition) puppetSound("pop snd") set the locV of sprite volumeSliderSpr to newPosV end if else if the mouseV < volumePanelMinV then if the locV of sprite volumeSliderSpr <> volumePanelMinV then changeVolume(appMgr, 6) puppetSound("pop snd") set the locV of sprite volumeSliderSpr to volumePanelMinV end if else if the mouseV > volumePanelMaxV then if the locH of sprite volumeSliderSpr <> volumePanelMaxV then changeVolume(appMgr, 0) puppetSound("pop snd") set the locV of sprite volumeSliderSpr to volumePanelMaxV end if end if end if end if updateStage() end repeat else if theSpr = volumePanelSpr then set btnBoundsLst to value(line 1 of field "volPalData") set theMouseH to theMouseH - the left of sprite theSpr set theMouseV to theMouseV - the top of sprite theSpr set theMouseLoc to point(theMouseH, theMouseV) repeat with buttonNum = 1 to count(btnBoundsLst) set theButtonBounds to getAt(btnBoundsLst, buttonNum) if inside(theMouseLoc, theButtonBounds) then set volumePosition to (buttonNum * 2) - 2 set newPosV to volumePanelMinV + (volumePosition * theVolumeIncrement) if newPosV <> the locV of sprite volumeSliderSpr then changeVolume(appMgr, 6 - volumePosition) puppetSound("pop snd") set the locV of sprite volumeSliderSpr to newPosV updateStage() startTimer() repeat while the timer < 6 end repeat end if exit repeat end if end repeat end if end if end on contentPaletteClick me, theSpr, theMouseH, theMouseV if theSpr = palArrowSpr then set showingPreviousPalette to 0 if theMouseH < the locH of sprite palArrowSpr then switchBank("left") else switchBank("right") end if else if theSpr = bookmarkSpr then if getOne([#HOM, #MAR, #bar, #LIS, #MAG], currentPalette) = 0 then gotoBookmark(theMouseH) end if else if theSpr = palHiliteSpr then set paletteIndex to getSelectedClip(theMouseH, theMouseV) set ok2Record to 1 if isSoundPalette then if (theMouseH > the left of sprite palHiliteSpr) and (theMouseH < (the left of sprite palHiliteSpr + 27)) and ((theMouseV > the top of sprite palHiliteSpr) and (theMouseV < (the top of sprite palHiliteSpr + 24))) then set ok2Record to 0 previewSound(playbackMgr, theCategory, currentBank, paletteIndex) end if end if repeat while the mouseDown end repeat if ok2Record then hidePalette() set bankOffset to 0 if bookmarkIndex <> 1 then repeat with theIndex = 1 to bookmarkIndex - 1 set bankOffset to bankOffset + getAt(bookmarkList, theIndex) end repeat end if setaProp(previousBankList, currentPalette, [bankOffset + currentBank, paletteIndex]) recordClip(recordMgr, theCategory, currentBank, paletteIndex) end if end if end if end if end on getSelectedClip thePosH, thePosV if isSoundPalette then set theColumn to ((thePosH - the left of sprite palAnimeSpr) / kHiliterWidth) + 1 set theRow to ((thePosV - the top of sprite palAnimeSpr) / kHiliterHeight) + 1 return theColumn + (5 * (theRow - 1)) else return ((thePosH - the left of sprite palAnimeSpr) / kHiliterWidth) + 1 end if end on gotoBookmark theMouseH set bookmarkButtonWidth to (the width of sprite bookmarkSpr / bookmarkTotal) + 2 set bookmarkSprH to the left of sprite bookmarkSpr set bookmarkIndex to ((the mouseH - bookmarkSprH) / bookmarkButtonWidth) + 1 switchBank(bookmarkIndex) end on switchBank direction set the locH of sprite palHiliteSpr to -1000 if direction = "right" then if currentBank < totalBanks then set currentBank to currentBank + 1 else if bookmarkIndex < bookmarkTotal then set currentBank to 1 set bookmarkIndex to bookmarkIndex + 1 set theCategory to getPropAt(bookmarkList, bookmarkIndex) set totalBanks to getaProp(bookmarkList, theCategory) else set currentBank to 1 set bookmarkIndex to 1 set theCategory to getPropAt(bookmarkList, bookmarkIndex) set totalBanks to getaProp(bookmarkList, theCategory) end if end if else if direction = "left" then if currentBank > 1 then set currentBank to currentBank - 1 else if bookmarkIndex > 1 then set bookmarkIndex to bookmarkIndex - 1 set theCategory to getPropAt(bookmarkList, bookmarkIndex) set totalBanks to getaProp(bookmarkList, theCategory) set currentBank to totalBanks else set bookmarkIndex to bookmarkTotal set theCategory to getPropAt(bookmarkList, bookmarkIndex) set totalBanks to getaProp(bookmarkList, theCategory) set currentBank to totalBanks end if end if else if integerp(direction) then set theCategory to getPropAt(bookmarkList, direction) set totalBanks to getaProp(bookmarkList, theCategory) set currentBank to 1 end if end if end if set bookmarkCast to getAt(paletteRecord, 5) + (bookmarkIndex - 1) set the castNum of sprite bookmarkSpr to the number of cast bookmarkCast set the width of sprite bookmarkSpr to the width of cast bookmarkCast set the height of sprite bookmarkSpr to the height of cast bookmarkCast if theType = #c then set bankOffset to 0 if bookmarkIndex <> 1 then repeat with theIndex = 1 to bookmarkIndex - 1 set bankOffset to bankOffset + getAt(bookmarkList, theIndex) end repeat end if set paletteCast to getAt(paletteRecord, 6) + ((currentBank - 1 + bankOffset) * 4) else if theType = #x then set bankOffset to 0 if bookmarkIndex <> 1 then repeat with theIndex = 1 to bookmarkIndex - 1 set bankOffset to bankOffset + getAt(bookmarkList, theIndex) end repeat end if set paletteCast to getAt(paletteRecord, 6) + ((currentBank - 1 + bankOffset) * 4) else set bankOffset to 0 if bookmarkIndex <> 1 then repeat with theIndex = 1 to bookmarkIndex - 1 set bankOffset to bankOffset + getAt(bookmarkList, theIndex) end repeat end if set paletteCast to getAt(paletteRecord, 6) + (currentBank - 1) + bankOffset end if end if set the castNum of sprite palAnimeSpr to paletteCast set paletteWidth to the width of cast paletteCast set the width of sprite palAnimeSpr to paletteWidth set paletteCounter to 1 end